<?xml version="1.0" encoding="utf-8"?>
<layout xmlns:android="http://schemas.android.com/apk/res/android"
        xmlns:binding="http://schemas.android.com/apk/res-auto">

    <data>

        <import type="cn.eoneplus.app.common.util.StringUtil" />

        <import type="android.view.View" />

        <import type="cn.eoneplus.mes.constant.EntityConstant" />

        <variable
                name="viewModel"
                type="cn.eoneplus.mes.ui.module.verification.${classname}.${ClassName}ItemViewModel" />
    </data>

    <androidx.cardview.widget.CardView
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:layout_margin="@dimen/common_margin"
            binding:cardCornerRadius="@dimen/cardCornerRadius"
            binding:onClickCommand="@{viewModel.itemClick}">

        <LinearLayout
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:orientation="horizontal">
            <!--卡片信息-->
            <LinearLayout
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:orientation="vertical">
                <#if status == true>
                <LinearLayout
                        android:layout_width="match_parent"
                        android:layout_height="wrap_content"
                        android:orientation="horizontal">
                    <View
                            android:layout_width="match_parent"
                            android:layout_height="@dimen/dimen_8"
                            android:layout_weight="3"
                            android:background="@{viewModel.status == 1 ? @color/orange : viewModel.status == 2 ? @color/blue : @color/gray}" />
                </LinearLayout>
                </#if>

                <LinearLayout
                        android:layout_width="match_parent"
                        android:layout_height="wrap_content"
                        android:orientation="vertical">

                    <#list childDTOList as child>
                    <!-- ${child.nameCN} -->
                    <#if child.type == "显示文字">
                    <LinearLayout
                            android:layout_width="match_parent"
                            android:layout_height="wrap_content"
                            android:orientation="horizontal"
                            android:visibility="@{true ? View.VISIBLE :View.GONE}">

                        <TextView
                                style="@style/ShowMainTextView_margin_small"
                                android:layout_width="@dimen/dimen_0"
                                android:layout_weight="1"
                                android:singleLine="true"
                                android:text='${child.nameCN}' />

                        <LinearLayout
                                android:layout_width="0dp"
                                android:layout_height="wrap_content"
                                android:layout_weight="4">

                            <TextView
                                    android:layout_width="wrap_content"
                                    android:layout_height="wrap_content"
                                    android:layout_marginLeft="@dimen/card_item_margin"
                                    android:layout_marginTop="@dimen/card_item_margin"
                                    android:text='@{viewModel.${child.name}}'
                                    android:textColor="@color/Blue" />
                        </LinearLayout>
                    </LinearLayout>
                    </#if>
                    </#list>

                </LinearLayout>
            </LinearLayout>
        </LinearLayout>
    </androidx.cardview.widget.CardView>
</layout>